package com.topscomm.main.config;

import com.topscomm.basic.exception.MessageException;
import com.topscomm.pub.vo.ResponseResult;
import com.topscomm.tap.constant.TapHttpErrorCode;
import com.topscomm.tap.constant.TapHttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class CbbPmExceptionHandler {
    @ExceptionHandler(MessageException.class)
    public ResponseResult<Object> handleMessageException(MessageException messageException){
        return ResponseResult.error(TapHttpStatus.HTTP_INTERNAL_ERROR, TapHttpErrorCode.ERROR_MESSAGE, messageException.getMessage());
    }
}
